package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.GarbageRecord;
import com.ruoyi.system.mapper.GarbageRecordMapper;
import com.ruoyi.system.service.GarbageRecordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: ruohao
 * @Date: 2023/9/2
 **/
@Service
public class GarbageRecordServiceImpl implements GarbageRecordService {
    @Resource
    private GarbageRecordMapper garbageRecordMapper;

    @Override
    public List<GarbageRecord> selectGarbageRecordList(GarbageRecord garbageRecord) {
        return garbageRecordMapper.selectList(garbageRecord);
    }

    @Override
    public List<GarbageRecord> selectAll() {
        return garbageRecordMapper.selectAll();
    }

    @Override
    public GarbageRecord selectGarbageRecordById(Long id) {
        return garbageRecordMapper.selectById(id);
    }

    @Override
    public Boolean createGarbageRecord(GarbageRecord GarbageRecord) {
        return garbageRecordMapper.insert(GarbageRecord) == 1;
    }

    @Override
    public Boolean updateGarbageRecord(GarbageRecord GarbageRecord) {
        return garbageRecordMapper.update(GarbageRecord) == 1;
    }

    @Override
    public Boolean deleteGarbageRecordById(Long id) {
        return garbageRecordMapper.deleteById(id) == 1;
    }
}
